Skip to content

Conversation

@alyssacgoins
Copy link
Contributor

@alyssacgoins alyssacgoins commented Sep 16, 2025

Resolves #12386

Description of your changes:
Add a custom_path field to the RuntimeArtifact object that overrides the object's URI field during artifact upload, allowing artifacts to be uploaded from non-local storage.

Changes validated via unit test in launcher_v2.Test_retrieve_artifact_path() as well as the sample pipeline component_with_runtime_artifact_custom_path.py added to test_data/sdk_compiled_pipelines/valid/critical, which sets and validates a custom artifact path.

Checklist:

@google-oss-prow
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@alyssacgoins alyssacgoins force-pushed the model-custom-upload-path branch 9 times, most recently from daab84c to 2120dcd Compare September 22, 2025 13:25
@alyssacgoins alyssacgoins force-pushed the model-custom-upload-path branch from 2120dcd to 545a55f Compare October 6, 2025 19:56
@google-oss-prow google-oss-prow bot added size/XXL and removed size/L labels Oct 6, 2025
@alyssacgoins alyssacgoins force-pushed the model-custom-upload-path branch from 7934fc1 to e24f5b1 Compare October 6, 2025 21:01
@google-oss-prow google-oss-prow bot added size/L and removed size/XXL labels Oct 6, 2025
@alyssacgoins alyssacgoins force-pushed the model-custom-upload-path branch 3 times, most recently from 29c50a9 to 23b7804 Compare October 7, 2025 15:23
@alyssacgoins alyssacgoins force-pushed the model-custom-upload-path branch 3 times, most recently from 329d06d to 4d5465a Compare October 21, 2025 20:09
@alyssacgoins alyssacgoins changed the title Model custom upload path feat(backend, sdk): Add custom_path field to RuntimeArtifact Oct 21, 2025
@alyssacgoins alyssacgoins force-pushed the model-custom-upload-path branch from 4d5465a to a174e85 Compare October 21, 2025 20:56
Comment on lines 633 to 635
if outputArtifact.CustomPath != nil {
localDir = *outputArtifact.CustomPath
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I missing something, or does this "duplicate" the above statement?
It seems like it can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right - I refactored the retrieveArtifactPath() logic after implementing this code block, so I completely missed it. Updated now

Comment on lines 746 to 760
func localPathForURI(uri string) (string, error) {
if strings.HasPrefix(uri, "gs://") {
return "/gcs/" + strings.TrimPrefix(uri, "gs://"), nil
}
if strings.HasPrefix(uri, "minio://") {
return "/minio/" + strings.TrimPrefix(uri, "minio://"), nil
}
if strings.HasPrefix(uri, "s3://") {
return "/s3/" + strings.TrimPrefix(uri, "s3://"), nil
}
if strings.HasPrefix(uri, "oci://") {
return "/oci/" + strings.ReplaceAll(strings.TrimPrefix(uri, "oci://"), "/", "_") + "/models", nil
}
return "", fmt.Errorf("failed to generate local path for URI %s: unsupported storage scheme", uri)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This duplicates the logic from backend/src/v2/component/launcher_v2.go.
Can we keep the component.LocalPathForURI function and use that in retrieveArtifactPath (in else)? With that, we can revert all the changes in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep - updated

@alyssacgoins alyssacgoins force-pushed the model-custom-upload-path branch 2 times, most recently from be47260 to 815bbf2 Compare October 23, 2025 15:00
@hbelmiro
Copy link
Contributor

@alyssacgoins can you please rebase?

Copy link
Contributor

@hbelmiro hbelmiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@droctothorpe
Copy link
Collaborator

/retest

@droctothorpe
Copy link
Collaborator

/lgtm

@alyssacgoins alyssacgoins force-pushed the model-custom-upload-path branch from 5551af8 to fe7b8f9 Compare October 29, 2025 13:39
@droctothorpe
Copy link
Collaborator

/approve

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: droctothorpe

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

@hbelmiro hbelmiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@google-oss-prow google-oss-prow bot added the lgtm label Oct 29, 2025
@google-oss-prow google-oss-prow bot merged commit 52d4595 into kubeflow:master Oct 29, 2025
130 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] Add custom_path field to RuntimeArtifact object

3 participants